#!/bin/bash

source ../scripts/func.bash

symlink Roboto-Bold.ttf /system/fonts/DroidSans-Bold.ttf
symlink Roboto-Regular.ttf /system/fonts/DroidSans.ttf
symlink gralloc.redhookbay.so.1.12.2701748 /system/vendor/lib/hw/gralloc.redhookbay.so /system/vendor/lib/hw/gralloc.redhookbay.so.1
symlink libEGL_POWERVR_SGX544_115.so.1.12.2701748 /system/vendor/lib/egl/libEGL_POWERVR_SGX544_115.so /system/vendor/lib/egl/libEGL_POWERVR_SGX544_115.so.1
symlink libGLESv1_CM_POWERVR_SGX544_115.so.1.12.2701748 /system/vendor/lib/egl/libGLESv1_CM_POWERVR_SGX544_115.so /system/vendor/lib/egl/libGLESv1_CM_POWERVR_SGX544_115.so.1
symlink libGLESv2.so /system/lib/libGLESv3.so
symlink libGLESv2_POWERVR_SGX544_115.so.1.12.2701748 /system/vendor/lib/egl/libGLESv2_POWERVR_SGX544_115.so /system/vendor/lib/egl/libGLESv2_POWERVR_SGX544_115.so.1
symlink libIMGegl.so.1.12.2701748 /system/vendor/lib/libIMGegl.so /system/vendor/lib/libIMGegl.so.1
symlink libPVROCL.so.1.12.2701748 /system/vendor/lib/libPVROCL.so /system/vendor/lib/libPVROCL.so.1
symlink libPVRRS.so.1.12.2701748 /system/vendor/lib/libPVRRS.so /system/vendor/lib/libPVRRS.so.1
symlink libPVRScopeServices.so.1.12.2701748 /system/vendor/lib/libPVRScopeServices.so /system/vendor/lib/libPVRScopeServices.so.1
symlink libglslcompiler.so.1.12.2701748 /system/vendor/lib/libglslcompiler.so /system/vendor/lib/libglslcompiler.so.1
symlink libhoudini.so.4.0.8.45720 /system/lib/libhoudini.so
symlink liboclcompiler.so.1.12.2701748 /system/vendor/lib/liboclcompiler.so /system/vendor/lib/liboclcompiler.so.1
symlink libpvr2d.so.1.12.2701748 /system/vendor/lib/libpvr2d.so /system/vendor/lib/libpvr2d.so.1
symlink libpvrANDROID_WSEGL.so.1.12.2701748 /system/vendor/lib/libpvrANDROID_WSEGL.so /system/vendor/lib/libpvrANDROID_WSEGL.so.1
symlink librsccompiler.so.1.12.2701748 /system/vendor/lib/librsccompiler.so /system/vendor/lib/librsccompiler.so.1
symlink librsccore.bc.1.12.2701748 /system/vendor/lib/librsccore.bc /system/vendor/lib/librsccore.bc.1
symlink libsrv_init.so.1.12.2701748 /system/vendor/lib/libsrv_init.so /system/vendor/lib/libsrv_init.so.1
symlink libsrv_um.so.1.12.2701748 /system/vendor/lib/libsrv_um.so /system/vendor/lib/libsrv_um.so.1
symlink libusc.so.1.12.2701748 /system/vendor/lib/libusc.so /system/vendor/lib/libusc.so.1
symlink memtrack.redhookbay.so.1.12.2701748 /system/vendor/lib/hw/memtrack.redhookbay.so /system/vendor/lib/hw/memtrack.redhookbay.so.1
symlink mksh /system/bin/sh
symlink toolbox /system/bin/cat /system/bin/chcon
symlink toolbox /system/bin/chmod /system/bin/chown /system/bin/clear
symlink toolbox /system/bin/cmp /system/bin/cp /system/bin/date
symlink toolbox /system/bin/dd /system/bin/df /system/bin/dmesg
symlink toolbox /system/bin/du /system/bin/getenforce /system/bin/getevent
symlink toolbox /system/bin/getprop /system/bin/getsebool /system/bin/grep
symlink toolbox /system/bin/hd /system/bin/id /system/bin/ifconfig
symlink toolbox /system/bin/iftop /system/bin/insmod /system/bin/ioctl
symlink toolbox /system/bin/ionice /system/bin/kill /system/bin/ln
symlink toolbox /system/bin/load_policy /system/bin/log /system/bin/ls
symlink toolbox /system/bin/lsmod /system/bin/lsof /system/bin/md5
symlink toolbox /system/bin/mkdir /system/bin/mkswap /system/bin/mount
symlink toolbox /system/bin/mv /system/bin/nandread /system/bin/netstat
symlink toolbox /system/bin/newfs_msdos /system/bin/notify /system/bin/printenv
symlink toolbox /system/bin/ps /system/bin/readlink /system/bin/renice
symlink toolbox /system/bin/restorecon /system/bin/rm /system/bin/rmdir
symlink toolbox /system/bin/rmmod /system/bin/route /system/bin/runcon
symlink toolbox /system/bin/schedtop /system/bin/sendevent
symlink toolbox /system/bin/setconsole /system/bin/setenforce
symlink toolbox /system/bin/setprop /system/bin/setsebool /system/bin/sleep
symlink toolbox /system/bin/smd /system/bin/start /system/bin/stop
symlink toolbox /system/bin/swapoff /system/bin/swapon /system/bin/sync
symlink toolbox /system/bin/top /system/bin/touch /system/bin/umount
symlink toolbox /system/bin/uptime /system/bin/vmstat /system/bin/watchprops
symlink toolbox /system/bin/wipe

set_metadata_recursive /system 0 0 0755 0644 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata_recursive /system/bin 0 2000 0755 0755 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata /system/bin/app_process 0 2000 0755 capabilities 0x0 selabel u:object_r:zygote_exec:s0
set_metadata /system/bin/clatd 0 2000 0755 capabilities 0x0 selabel u:object_r:clatd_exec:s0
set_metadata /system/bin/dbus-daemon 0 2000 0755 capabilities 0x0 selabel u:object_r:dbusd_exec:s0
set_metadata /system/bin/debuggerd 0 2000 0755 capabilities 0x0 selabel u:object_r:debuggerd_exec:s0
set_metadata /system/bin/dhcpcd 0 2000 0755 capabilities 0x0 selabel u:object_r:dhcp_exec:s0
set_metadata /system/bin/dnsmasq 0 2000 0755 capabilities 0x0 selabel u:object_r:dnsmasq_exec:s0
set_metadata /system/bin/drmserver 0 2000 0755 capabilities 0x0 selabel u:object_r:drmserver_exec:s0
set_metadata /system/bin/hostapd 0 2000 0755 capabilities 0x0 selabel u:object_r:hostapd_exec:s0
set_metadata /system/bin/installd 0 2000 0755 capabilities 0x0 selabel u:object_r:installd_exec:s0
set_metadata /system/bin/keystore 0 2000 0755 capabilities 0x0 selabel u:object_r:keystore_exec:s0
set_metadata /system/bin/mediaserver 0 2000 0755 capabilities 0x0 selabel u:object_r:mediaserver_exec:s0
set_metadata /system/bin/mksh 0 2000 0755 capabilities 0x0 selabel u:object_r:shell_exec:s0
set_metadata /system/bin/mtpd 0 2000 0755 capabilities 0x0 selabel u:object_r:mtp_exec:s0
set_metadata /system/bin/netcfg 0 3003 02750 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata /system/bin/netd 0 2000 0755 capabilities 0x0 selabel u:object_r:netd_exec:s0
set_metadata /system/bin/ping 0 0 0755 capabilities 0x0 selabel u:object_r:ping_exec:s0
set_metadata /system/bin/pppd 0 2000 0755 capabilities 0x0 selabel u:object_r:ppp_exec:s0
set_metadata /system/bin/racoon 0 2000 0755 capabilities 0x0 selabel u:object_r:racoon_exec:s0
set_metadata /system/bin/rild 0 2000 0755 capabilities 0x0 selabel u:object_r:rild_exec:s0
set_metadata /system/bin/run-as 0 2000 0750 capabilities 0xc0 selabel u:object_r:runas_exec:s0
set_metadata /system/bin/sdcard 0 2000 0755 capabilities 0x0 selabel u:object_r:sdcardd_exec:s0
set_metadata /system/bin/servicemanager 0 2000 0755 capabilities 0x0 selabel u:object_r:servicemanager_exec:s0
set_metadata /system/bin/surfaceflinger 0 2000 0755 capabilities 0x0 selabel u:object_r:surfaceflinger_exec:s0
set_metadata /system/bin/vold 0 2000 0755 capabilities 0x0 selabel u:object_r:vold_exec:s0
set_metadata /system/bin/wpa_supplicant 0 2000 0755 capabilities 0x0 selabel u:object_r:wpa_exec:s0
set_metadata_recursive /system/etc/dhcpcd 0 0 0755 0644 capabilities 0x0 selabel u:object_r:dhcp_system_file:s0
set_metadata /system/etc/dhcpcd/dhcpcd-run-hooks 1014 2000 0550 capabilities 0x0 selabel u:object_r:dhcp_system_file:s0
set_metadata_recursive /system/etc/ppp 0 0 0755 0555 capabilities 0x0 selabel u:object_r:ppp_system_file:s0
set_metadata /system/vendor 0 2000 0755 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata_recursive /system/vendor/bin 0 2000 0755 0755 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata /system/vendor/etc 0 2000 0755 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata /system/vendor/lib 0 2000 0755 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata_recursive /system/vendor/lib/drm 0 2000 0755 0644 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata /system/vendor/lib/drm/libdrmwvmplugin.so 0 0 0644 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata /system/vendor/lib/egl 0 2000 0755 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata /system/vendor/lib/hw 0 2000 0755 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata_recursive /system/vendor/lib/mediadrm 0 2000 0755 0644 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata /system/vendor/lib/mediadrm/libwvdrmengine.so 0 0 0644 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata /system/vendor/media 0 2000 0755 capabilities 0x0 selabel u:object_r:system_file:s0
set_metadata_recursive /system/xbin 0 2000 0755 0755 capabilities 0x0 selabel u:object_r:system_file:s0
